package com.operate.service;

import com.operate.bean.RiseProportion;
import com.operate.dao.GpMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: ZZZ
 */
@Slf4j
@Service
public class RiseProportionService {

    @Autowired
    private GpMapper gpMapper;

    public List<RiseProportion> riseProportionQuery() {
        List<RiseProportion> list = gpMapper.riseProportionQuery();
        List<RiseProportion> list2=new ArrayList<>();
        int k = 0;
        for (RiseProportion riseProportion : list) {
            if (riseProportion.getType().equals("1")) {
                if (k > 90) {
                    break;
                }
                k++;
                RiseProportion riseProportion2 = new RiseProportion();
                riseProportion2.setType("2");
                riseProportion2.setRiseNum(riseProportion.getRiseNum());
                riseProportion2.setDay(riseProportion.getDay());
                list2.add(riseProportion2);
            }
        }
        list.addAll(list2);
        return list;
    }


}
